package cz.apnetis.fitweb.client;

import java.util.List;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

import cz.apnetis.fitweb.shared.Food;

@RemoteServiceRelativePath("food.do")
public interface FoodService extends RemoteService {

  /** Save food to database and return key of saved food */
  String save(Food food) throws IllegalArgumentException;

  /** Remove given food from database */
  String remove(Food food) throws IllegalArgumentException;

  /** List of all food of user */
  List<Food> allFood();

  /** Food of given period
   * @param period period of year which is show
   * @param offset how many period in back is show, elsewhere is show current period
   * @return list of foods in period
   */
  List<Food> foodOfPeriod(int period, int offset, int timeZoneOffset);
}
